package com.saint.stock.controller;

import com.saint.stock.service.StockService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@RequiredArgsConstructor(onConstructor = @_(@Autowired))
@RequiredArgsConstructor
public class StockController {

    private final StockService stockService;

//    @SentinelResource("deduct")
    @GetMapping(path = "/deduct")
    public Boolean deduct(String commodityCode, Integer count) {
        stockService.deduct(commodityCode, count);
        return true;
    }
}